package edu.fzu.costlog.service;

import java.util.List;

import edu.fzu.costlog.dao.CostLogDao;
import edu.fzu.costlog.dao.CostLogDaoJDBCImpl;
import edu.fzu.costlog.domain.CostLog;

public class CostLogServiceImpl implements CostLogService {

	public void saveCostLog(CostLog log) {
		
		CostLogDao logDao = new CostLogDaoJDBCImpl();
		logDao.addLog(log);
	}

	public List<CostLog> loadall() {
		
		CostLogDao logDao = new CostLogDaoJDBCImpl();
		return logDao.loadall();
	}

	public void removeCostLog(Integer logId) {
		
		CostLogDao logDao = new CostLogDaoJDBCImpl();
		logDao.delLog(logId);
	}

	public CostLog getCostLogById(Integer logId) {
		
		CostLogDao logDao = new CostLogDaoJDBCImpl();
		return logDao.getLogById(logId);
	}

	public void updateCostLog(CostLog log) {
		
		CostLogDao logDao = new CostLogDaoJDBCImpl();
		logDao.updateLog(log);
	}

}
